# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gegl
pkgver=0.4.46
pkgrel=0
pkgdesc="Graph based image processing framework"
url="https://www.gegl.org/"
arch="all"
license="GPL-3.0-or-later AND LGPL-3.0-or-later"
makedepends="
	babl-dev
	ffmpeg-dev
	gdk-pixbuf-dev
	gobject-introspection-dev
	json-glib-dev
	libjpeg-turbo-dev
	libpng-dev
	libraw-dev
	librsvg-dev
	libwebp-dev
	meson
	pango-dev
	vala
	"
checkdepends="diffutils"
subpackages="$pkgname-dev $pkgname-lang"
source="https://download.gimp.org/pub/gegl/${pkgver%.*}/gegl-$pkgver.tar.xz
	arm-neon-v1.patch
	"

# secfixes:
#   0.4.34-r0:
#     - CVE-2021-45463

build() {
	CFLAGS="$CFLAGS -O2" \
	abuild-meson \
		-Db_lto=true \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
cd733208da7dc1ec77ca023f03f47e578350e156ad07ece701b39f517a292e9f9c081b3a8a2db846813483b4ddb21f32f9fc8b9c70fea8a6ba27bb97ef8bb847  gegl-0.4.46.tar.xz
add122d409354b3aaa205adaa6fac5003fbc83f23ffcf5d230edf2b390b36c168fbfd89c47a5bdf41c06254403eff4347c2c667e18d84cdf00857e743c29b03b  arm-neon-v1.patch
"
